// 数据回显Mock
Mock.mock("/js/showhometeaPage", "post", function () {
    let teaarr = localStorage.Tea;
    let teashowdiv = document.querySelector(".siximgs");
    let showPage = "";
    if (teaarr == "" || teaarr == null || teaarr == undefined || teaarr == []) {
        teashowdiv.innerHTML =
            `<div>
                        <img src="../imgs/" alt="">
                        <div class="teaname">暂无数据/div>
                        <div class="teaprice">￥暂无数据</div>
                    </div>`;
    } else {
        let tea1 = JSON.parse(teaarr);
        let num = 0;
        for (let i = tea1.length - 1; i >= 0; i--) {
            num++;
            showPage += `<div class="siximgsdiv" onclick="showTeaPage(${tea1[i].teaid})">
                        <img src="../imgs/${tea1[i].teaimg}" alt="">
                        <div class="teaname">${tea1[i].teaname}</div>
                        <div class="teaprice">￥${tea1[i].teaprice}</div>
                        </div>`;

            if (num == 6) {
                break;
            }
        }

    }
    return showPage;
})

// 将本地存储返回给/js/showTeaPageGetLocal
Mock.mock("/js/showTeaPageGetLocal", "post", function () {
    let local = localStorage.Tea;
    return local;
})



